In order to efficiently transmit or record moving images, a moving image coding apparatus (image coding apparatus) for generating coded data by coding a moving image, and a moving image decoding apparatus (image decoding apparatus) for generating a decoded image by decoding the coded data, are used.
As a specific moving image coding method, for example, there are methods (NPL 1) proposed in H. 264/MPEG-4. AVC, and High-Efficiency Video Coding (HEVC) which is a succeeding codec thereof.
In such moving image coding methods, an image (picture) forming a moving image is managed in a layer structure which is constituted by a slice obtained by dividing the image, a coding unit obtained by dividing the slice, and a block and a partition obtained by dividing the coding unit, and the image is commonly coded and decoded for each block.
In addition, in these coding methods, typically, a predicted image is generated on the basis of a local decoded image obtained by coding and decoding an input image, and coding is performed on a transform coefficient which is obtained by performing frequency transform such as discrete cosine transform (DCT) on a difference image (also referred to as a “residual image” or “prediction residual” in some cases) between the predicted image and the input image for each block.
As a specific coding method of a transform coefficient, context-based adaptive binary arithmetic coding (CABAC) is known.
In the CABAC, a binarization process is performed on various syntaxes indicating a transform coefficient, and binary data obtained through the binarization process is arithmetically coded. Here, the various syntaxes include a flag indicating whether or not a transform coefficient is 0, that is, a flag significant_coeff_flag (also referred to as coefficient presence/absence flag) indicating whether or not a non-zero coefficient is present, a flag coeff_abs_level_greater1_flag (also referred to as a GR1 flag) indicating whether or not an absolute value of a transform coefficient exceeds 1, a flag coeff_abs_level_greater2_flag (also referred to as a GR2 flag) indicating whether or not an absolute value of a transform coefficient exceeds 2, syntaxes last_significant_coeff_x and last_significant_coeff_y indicating a position of the last non-zero coefficient in a process order, and the like.
In addition, in the CABAC, when a single symbol (also referred to as 1 bit of binary data, or a Bin) is coded, a context index is referred to, and arithmetic coding corresponding to an occurrence probability indicated by a probability state index included in a context variable designated by the context index is performed. For example, in a case where a target syntax of arithmetic coding is a coefficient presence/absence flag, the context index is derived in accordance with a position in a frequency component of a transform coefficient. In addition, the occurrence probability designated by the probability state index is updated whenever a single symbol is coded. Further, in the following description, a process of deriving a context index which is referred to when a specific Bin is coded is also referred to as a context deriving process.
In NPL 1, as a method of coding signs indicating positive and negative transform coefficients, sign hiding is employed. The sign hiding is a method in which a sign of a transform coefficient is not explicitly coded but is calculated through computation.
In addition, in NPL 1, two-layer coding is employed as a method of coding a non-zero coefficient. In the two-layer coding, the transform unit is split into a plurality of sub-blocks, a flag (significant_coeff_flag) indicating whether or not a transform coefficient is non-zero is coded for each transform coefficient included in each sub-block, and a flag (significant_coeff_group_flag) indicating whether or not a non-zero coefficient is included in each sub-block is coded in the sub-block units.
Further, in NPL 1, the following coding is performed as follows in accordance with a size of the transform unit (TU). In other words, in the small TU (4×4 or 8×8), 4×4 or 8×2 is used as a sub-block size, and a context which is assigned to a frequency component on the basis of a position is derived. In the context derivation based on a position, a context index (also referred to as a position context) which is defined in accordance with a position of a frequency component in a frequency domain is assigned to the frequency component.
In addition, in the large TU (16×16, 32×32, 16×4, 4×16, 32×8, or 8×32), 4×4 is used as a sub-block size, and a context which is assigned to a frequency component on the basis of periphery reference is derived. In the context derivation based on periphery reference, a context index (also referred to as a periphery reference context) which is defined in accordance with the number of non-zero coefficients (that is, significant_coeff_flag is referred to) in peripheral frequency components of a corresponding frequency component is assigned to the frequency component.
In addition, NPL 2 discloses a technique for controlling whether or not a frequency transform process is skipped for each transform unit. Hereinafter, skipping of the frequency transform process is referred to as a transform skip.
Further, NPL 3 discloses a technique for controlling whether or not a frequency transform process or a quantization and loop filter process are skipped for each coding unit. Hereinafter, skipping of the frequency transform and quantization processes is referred to as a transform/quantization bypass. The transform/quantization bypass is mainly used for lossless coding. For this reason, the skipping of the frequency transform and quantization processes may not be referred to as a transform/quantization bypass but is simply referred to as a lossless mode.